package com.oktest.measure.db.room

import androidx.room.*
import com.oktest.measure.entity.HomeNotice

/**
 * @Author hhh
 * @Date 2020/10/23
 */
@Dao
interface HomeNoticeDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(vararg notice:HomeNotice)

    @Insert(onConflict = OnConflictStrategy.IGNORE)
    fun insertList(notices:List<HomeNotice>)

    @Query("select * from HomeNotice where id=:id")
    fun load(id: String): HomeNotice?

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun update(notice: HomeNotice)

    @Query("select * from HomeNotice")
    fun loadAll(): List<HomeNotice>
}